<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            background-color: yellow;
        }
    </style>
</head>
<body>

<!-- c 按下tab emmet快速编写代码语法 -->
<!-- 选中标签代码，按下ctrl + / 设置html注释，再按取消注释 -->
<!-- 第一种 在网页编写javascript的方法，事件方式 onclick鼠标单击 -->
<button onclick="document.body.style.backgroundColor = this.innerText">red</button>
<button onclick="document.body.style.backgroundColor = this.innerText">green</button>
<button onclick="document.body.style.backgroundColor = this.innerText">blue</button>
<button onclick="document.body.style.backgroundColor = this.innerText">purple</button>
<button onclick="document.body.style.backgroundColor = this.innerText">#336699</button>
<button ondblclick="document.body.style.backgroundColor = 'orange'">双击Orange按钮</button>

<hr>
<button onmouseover="document.body.style.backgroundColor = `rgb(${Math.round(Math.random()*255)},${Math.round(Math.random()*255)},${Math.round(Math.random()*255)})`">random-color</button>
</body>
</html>
